package com.day33;

public class A {
    A(){
        System.out.println("调用A的无参构造方法");
    }

    A(int i){
        System.out.println("调用A的有参构造方法");
    }

    String name;
    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name=name;
    }
}

class B extends A{
    B(){
        super();
        System.out.println("调用B的无参构造方法");
    }

    B(int i){
        super(i);
        System.out.println("调用B的有参构造方法");
    }
}

class C extends B{
    C(){
        super();
        System.out.println("调用C的无参构造方法");
    }

    C(int i){
        super(i);
        System.out.println("调用C的有参构造方法");
    }

    String name;
    String sex;
    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name=name;
    }

    public String getSex(){
        return sex;
    }

    public void setSex(String sex){
        this.sex=sex;
    }
}